package com.hfkh;

import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class Code06 {
    public static void main(String[] args) {
        int[] score = new int[5];
        double total, avg;
        total = avg = 0;
        int max, min;
        max = min = 0;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入5名同学的成绩：");
        for (int i = 0; i < score.length; i++) {
            score[i] = sc.nextInt();
        }
        max = score[0];
        min = score[0];
        for (int j = 0; j < score.length; j++) {
            total += score[j];
            if (score[j] > max) {
                max = score[j];
            }
            if (score[j] < min) {
                min = score[j];
            }
        }
        avg = total / score.length;
        System.out.print("总成绩：" + total + "\t\t平均分：" + avg + "\n");
        System.out.println("最高分：" + max + "\t\t最低分：" + min);
    }
}
